package net.wangxl.miaosha;

import net.wangxl.miaosha.service.MiaoshaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 模拟单机的秒杀场景
 * @Author: wangxl
 * @Date: 2019/1/12 16:14
 */
@RestController
@RequestMapping("/miaosha")
public class MiaoShaController {

    @Autowired
    private MiaoshaService miaoshaService;


    @GetMapping("/computer/{userId}")
    public String miaosha(@PathVariable String userId){
        miaoshaService.miaosha(userId);
        return "0";
    }

}
